import { lisfun } from "api/homeapi.js"
export let gddata = {
    state: {
        obj: [],
        livedata: []
    },
    getters: {

    },
    mutations: {
        suibian(state, paylod) {
            state.obj = paylod
        },
        // 首页直播
        lives(state, paylod) {
            state.livedata = paylod
        }
    },
    actions: {
        homelist(context) {
            lisfun().then((ok) => {
                console.log(ok)
                context.commit("suibian", ok.data.house)
            }).catch((err) => {
                console.log(err)
            })
        },
        // 首页直播
        livelist(context) {
            lisfun().then((ok) => {
                console.log(ok)
                context.commit("lives", ok.data.live)
            }).catch((err) => {
                console.log(err)
            })
        }
    }
}